package com.work.rabbitmqdemo.service.impl;

import com.work.rabbitmqdemo.config.RabbitMQConfig;
import com.work.rabbitmqdemo.service.MessageService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Override
    public void send(String msg) {
        rabbitTemplate.convertAndSend(RabbitMQConfig.QUEUE_NAME,msg);
    }
}
